package com.fjzn.detect.start.common;

import com.fjzn.detect.core.result.ResponseResult;
import lombok.extern.log4j.Log4j2;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile;


/**
 * 通用请求处理
 *
 * @author helloworld
 */
@RestController
@Log4j2
public class CommonController {

    /**
     * 下载路径
     */
    private final static String DOWNLOAD_PATH = "/";

    /**
     * 本地资源路径
     */
    private final static String LOCAL_PATH = "/";

    /**
     * 通用上传请求
     */
    @PostMapping("/common/upload")
    public ResponseResult<String> uploadFile(MultipartFile file) throws Exception {
        try {
            // 上传并返回新文件名称
            String url = "";

            return ResponseResult.success(url);
        } catch (Exception e) {
            return ResponseResult.error("系统异常");
        }
    }

}
